package com.dq.repository.goods;

import com.dq.domain.goods.Goods;
import com.dq.domain.goods.Product;
import com.dq.domain.org.Org;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author liuhui
 * @date 2019/9/17 0017 11:25:48
 */
@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {

    /**
     * 获取goods 下所有 product
     */
    List<Product> findByGoodsAndDeletedFalse(Goods goods);
    List<Product> findByGoodsAndDeletedFalseAndIsDefaultFalse(Goods goods);
    Product findByGoodsAndDeletedFalseAndIsDefaultTrue(Goods goods);

    List<Product> findByIdIn(List<Long> longs);

}
